import java.io.*;
import java.io.File;
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;

public class Logger {

	public boolean NewLogEntry(boolean DoubleLogToScreen, String entry, File logFile)
	{
		if (DoubleLogToScreen)
		{
			try 
			{
				System.out.println(entry);
				BufferedWriter output = new BufferedWriter(new FileWriter(logFile, true));
				output.write('\n' + entry  + '\n');
				output.close();
				return true;
			}
			catch (IOException e) 
			{
				e.printStackTrace();
				return false;
			}
		}
		
		try 
			{
				BufferedWriter output = new BufferedWriter(new FileWriter(logFile, true));
				output.write(entry);
				output.close();
				return true;
			} 
		catch (IOException e) 
			{
				e.printStackTrace();
				return false;
			}
	}
	
}
